********************************************************************************		
************** Histogram with level and change in political attitudes **********
********************************************************************************		
	clear
	use "BHPS_merged.dta"
	sort pid waven 
	
	set scheme plottig
		
	* Nationalism
	sum nationalism D3_nationalism
	corr L3.nationalism D3_nationalism
	
	hist nationalism, ytitle("percent") xtitle("nationalist attitude") percent discrete ylabel(0 (5) 15) xlabel(-3 (1) 3) note("mean=2.25; standard deviation=0.91") name(gr1, replace) nodraw
	hist D3_nationalism, ytitle("percent") xtitle("first difference in nationalist attitude") percent discrete xlabel(-3 (1) 3) note("mean=-0.01; standard deviation=0.87") name(gr2, replace) nodraw
	twoway (scatter L3.nationalism D3_nationalism, msymbol(p) msize(tiny) jitter(3) ) (lfit L3.nationalism D3_nationalism), ytitle("lagged level") xtitle("first difference in nationalist attitude") xlabel(-3 (1) 3) note("correlation=-0.50") legend(off) name(gr3, replace) nodraw
	
	graph combine gr1 gr2 gr3, col(1) xcommon imargin(small) title(nationalist attitude) name(nationalism_change, replace) nodraw
				
				
	* EU support			
	sum EUsupport D_EUsupport
	corr LDV_EUsupport D_EUsupport
	
	hist EUsupport, ytitle("percent") xtitle("support for EU membership") percent discrete ylabel(0 (10) 30) xlabel(-3 (1) 3) note("mean=1.23; standard deviation=0.75") name(gr1, replace) nodraw
	hist D_EUsupport, ytitle("percent") xtitle("first difference in support for EU membership") percent discrete xlabel(-3 (1) 3) note("mean=-0.09; standard deviation=0.64") name(gr2, replace) nodraw
	twoway (scatter LDV_EUsupport D_EUsupport, msymbol(p) msize(tiny) jitter(3)) (lfit LDV_EUsupport D_EUsupport), ytitle("lagged level")  xtitle("first difference in support for EU membership") xlabel(-3 (1) 3) note("correlation=-0.42") legend(off) name(gr3, replace) nodraw
	graph combine gr1 gr2 gr3, col(1) xcommon imargin(small) title(support for EU membership) name(EUsupport_change, replace) nodraw
				
	graph combine EUsupport_change nationalism_change, iscale(*1.1) name(DV_plots, replace)